package com.example.mapper;

import com.example.entity.Floor;
import com.example.entity.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface FloorMapper {

    @Select("SELECT * FROM floor where floor_num=#{floor_num}")
    List<Floor> findAllByid(String floor_num);

    @Select("SELECT * FROM floor where admin_num=#{admin_num}")
    List<Floor> findAllByadmin_num(String admin_num);

    int update(Floor floor);

    int insert(Floor floor);
    @Delete("DELETE FROM floor WHERE floor_num = #{floor_num}")
    Integer deleteBy(@Param("floor_num") String floor_num);

    List<Floor> selectDormitoryPage(Integer pageNum, Integer pageSize, String category);

    Integer selectDormitoryTotal(String name);
}
